package com.kfm.jdbc.day0404.thread;

public class SleepDemo {

    public static void main(String[] args) {
        MyThread mt = new MyThread("线程A");
//        mt.setPriority(10);
        System.out.println(mt.getPriority());
        System.out.println(Thread.currentThread().getPriority());
        mt.start();

        try {
            // main 线程等待(阻塞) mt 线程执行完毕
            mt.join(2000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }

        for (int i = 0; i < 10; i++) {
            System.out.println("main线程执行了" + i + "次");
        }
    }
}
